﻿<Application x:Class="CloudClipboardSync.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:TaskbarNotification="clr-namespace:Hardcodet.Wpf.TaskbarNotification;assembly=Hardcodet.Wpf.TaskbarNotification"
             xmlns:Model="clr-namespace:CloudClipboardSync.Model"
             xmlns:KT="clr-namespace:CloudClipboardSync.Converters" Startup="ApplicationStartup" ShutdownMode="OnExplicitShutdown">
    <Application.Resources>
        <Model:ProgramData x:Key="programData" />
        <KT:VisibilityConverter x:Key="HideIfFalse" NonVisibleValue="False" Hide="True" />
        <KT:VisibilityConverter x:Key="VisibleIfTrue" VisibleValue="True" />
        <KT:VisibilityConverter x:Key="VisibleIfFalse" VisibleValue="False" />
        <KT:VisibilityConverter x:Key="VisibleIfZero" VisibleValue="0" />
        <KT:VisibilityConverter x:Key="VisibleIfNonZero" NonVisibleValue="0" />
        <KT:VisibilityConverter x:Key="VisibleIfEmpty" VisibleValue="" />
        <KT:VisibilityConverter x:Key="VisibleIfNonEmpty" NonVisibleValue="" />
        <KT:VisibilityConverter x:Key="VisibleIfNotNull" NonVisibleValue="null" VisibleValue="x" />
        <KT:VisibilityConverter x:Key="VisibleIfNull" VisibleValue="null" />
        <KT:NegateConverter x:Key="NegateConverter" />
        <KT:VisibleIfConverter x:Key="VisibleIfParam" />
        <KT:VisibleIfConverter x:Key="VisibleIfNotParam" IfNotMatch="true"/>
        <TaskbarNotification:TaskbarIcon x:Key="systrayIcon" DataContext="{Binding Source={StaticResource programData}}"
                            LeftClickCommand="{Binding ShowContextMenuCommand}"
                            DoubleClickCommand="{Binding OpenProgramCommand}">
            <TaskbarNotification:TaskbarIcon.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Open program" FontWeight="Bold" Command="{Binding OpenProgramCommand}" />
                    <Separator />
                    <MenuItem Header="Settings" Command="{Binding ShowSettingsWindowCommand}" IsEnabled="{Binding IsLoggedIn, Mode=OneWay}" />
                    <MenuItem Header="Clear clipboard" Command="{Binding ClearClipboardCommand}" IsEnabled="{Binding IsLoggedIn, Mode=OneWay}" />
                    <Separator />
                    <MenuItem Header="Exit" Command="{Binding ExitCommand}" />
                </ContextMenu>
            </TaskbarNotification:TaskbarIcon.ContextMenu>
        </TaskbarNotification:TaskbarIcon>

    </Application.Resources>
</Application>
